﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace ShopFine.Models
{
    public class CategoryDAO
    {
        ShopFineEntities db;
        public CategoryDAO()
        {
            db = new ShopFineEntities();
        }

        public List<Category> GetAll()
        {
            return db.Categories.ToList();
        }

        internal Category GetCategoryByID(int cateID)
        {
            return db.Categories.FirstOrDefault(p=>p.ID == cateID);
        }
    }
}